require "Common/define"
require "Logic/FrameManager"
require "Logic/Config"
require "proto/picFrame/message/ReqSendFrameInfoMessage"
require "proto/picFrame/message/ResSendFrameInfoMessage"

picFrameHandler = picFrameHandler or {};

function picFrameHandler.ReqSendFrameInfo()
    local rdtr = ReqSendFrameInfoMessage.New();
    sendReqMessage(rdtr);
end

function picFrameHandler.ResSendFrameInfo(msg)
    if msg.state == 0 then
        FrameManager.SaveActiveFrame(msg)
        FireEvent(Config.EventType.Refresh_Frame, { tostring(msg.show) })
        logicMgr.HeroManager.SetRoleInfo("picFrame", tostring(msg.show))
        --local headPic = logicMgr.HeroManager.GetRoleInfo("pic");
        --roleInfoHandler.SendReqModifyPicMessage("", msg.frame);
        FireEvent(Config.EventType.HeadFrameInfo)
        FireEvent(Config.EventType.FreashRoleShowDraw)
    end
end